type DictType = Array<{ label: string; value: string | number }>;

export const scoreTypeOption: DictType = [
  { value: 1, label: '健身课程' },
  { value: 2, label: '营养食谱' },
];

/**
 * 根据value和字典获取label
 * @param value
 * @param dict
 * @returns
 */
export function getLabelByValue(value: string, dict: DictType): string {
  const option = dict.find((option) => option.value === value);
  return option ? option.label : '';
}
